#ifndef KCUSTOMDATEEDIT_H
#define KCUSTOMDATEEDIT_H

#include "../screencapsdk_global.h"
#include <QDateTimeEdit>
#include <QMouseEvent>
#include "kminicalendarwidget.h"

namespace kdk
{
class KCustomDateEditPrivate;

/**
 *  @defgroup KCustomDateEdit
 *  @since 2.5
 */

class SCREENCAPSDK_EXPORT KCustomDateEdit : public QDateTimeEdit
{
    Q_OBJECT
public:
    KCustomDateEdit(QWidget *parent = nullptr);

    /**
     * @brief 触发日历控件显示
     */
    void showCalendar();

    /**
     * @brief 是否显示农历
     * @param showLunar
     */
    void setShowLunar(bool showLunar);

    /**
     * @brief 适应系统风格
     * @param isDark：是否深色模式
     */
    void updateStyle(bool isDark);

signals:
    void changeDate();

protected:
    void mousePressEvent(QMouseEvent *event) override;
    void paintEvent(QPaintEvent *e) override;
    bool eventFilter(QObject *obj, QEvent *event) override;

private:
    Q_DECLARE_PRIVATE(KCustomDateEdit)
    KCustomDateEditPrivate* const d_ptr;
};
}

#endif // KCUSTOMDATEEDIT_H
